<?php
/* $Id: tech.reports.php,v 1.2 2003/10/08 07:24:55 tuxmonkey Exp $ */

if (strpos($_SERVER['PHP_SELF'],basename(__FILE__)) !== false) {
  print "Direct module access forbidden.".basename(__FILE__);exit;}
  
if (!is_manager()) {
  redirect();
}

$rep = new ITreport;

$fields = array(
  "gid"         => $lg->group,
  "assigned_to" => $lg->assigned_to,
  "opened_by"   => $lg->opened_by,
  "opened"      => $rep->time_opened,
  "closed"      => $rep->time_closed,
  "modified"    => $lg->last_modified,
//  "status"      => $lg->status,
  "category"    => $lg->type,
  "product"     => $lg->product,
  "severity"    => $rep->show_priority,
  "problem"     => $lg->long_description,
);

$options = array(
  "avgclose"    => $rep->avgclose,
  "maxclose"    => $rep->maxclose,
  "avgfirst"    => $rep->avgfirst,
  "maxfirst"    => $rep->maxfirst,
  "percat"      => $rep->percat,
  "perstat"     => $rep->perstat,
  "perprod"     => $rep->perprod,
  "persev"      => $rep->persev,
  "pertech"     => $rep->pertech,
  "opened"      => $rep->nb_opened,
  "resolved"    => $rep->resolved,
  "numevents"   => $rep->numevents,
  "numhours"    => $rep->numhours
);
  
$sql  = "SELECT userid,username ";
$sql .= "FROM users ";
$sql .= "ORDER BY username";
$users = $dbi->fetch_all($sql,"array");
$smarty->assign('users',$users);
$smarty->assign('fields',$fields);
$smarty->assign('options',$options);
$smarty->display("reports/tech.tpl");
?>